🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / core / ui / src / commonMain / kotlin / org / meshtastic / core / ui / qr / ScannedQrCodeViewModel.kt
Displaying Raw • Download
core/ui/src/commonMain/kotlin/org/meshtastic/core/ui/qr/ScannedQrCodeViewModel.kt cea2c3a015c2c3227f13a3ac9bc4e13c35bbd4ee (cea2c3a0) Text, 2.14 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.ui.qr
Tff7b72import T7ee787androidx.lifecycle.ViewModel
Tff7b72import T7ee787kotlinx.coroutines.flow.map
Tff7b72import T7ee787org.koin.core.annotation.KoinViewModel
Tff7b72import T7ee787org.meshtastic.core.repository.NodeRepository
Tff7b72import T7ee787org.meshtastic.core.repository.RadioConfigRepository
Tff7b72import T7ee787org.meshtastic.core.repository.RadioController
Tff7b72import T7ee787org.meshtastic.core.ui.util.importChannelSet
Tff7b72import T7ee787org.meshtastic.core.ui.viewmodel.safeLaunch
Tff7b72import T7ee787org.meshtastic.core.ui.viewmodel.stateInWhileSubscribed
Tff7b72import T7ee787org.meshtastic.proto.ChannelSet
Tff7b72internal Tff7b72const Tff7b72val Te6edf3DEFAULT_MAX_CHANNELS Tff7b72= T79c0ff8
Tf0883e@KoinViewModel
Tff7b72class T56d364ScannedQrCodeViewModelTb4b4b4(
Tff7b72private Tff7b72val Te6edf3radioConfigRepositoryTb4b4b4: Te6edf3RadioConfigRepositoryTb4b4b4,
Tff7b72private Tff7b72val Te6edf3radioControllerTb4b4b4: Te6edf3RadioControllerTb4b4b4,
Te6edf3nodeRepositoryTb4b4b4: Te6edf3NodeRepositoryTb4b4b4,
Tb4b4b4) Tb4b4b4: Te6edf3ViewModelTb4b4b4(Tb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3channels Tff7b72= Te6edf3radioConfigRepositoryTb4b4b4.Te6edf3channelSetFlowTb4b4b4.Te6edf3stateInWhileSubscribedTb4b4b4(Te6edf3initialValue Tff7b72= Te6edf3ChannelSetTb4b4b4(Tb4b4b4)Tb4b4b4)
Tff7b72val Te6edf3maxChannels Tff7b72=
Te6edf3nodeRepositoryTb4b4b4.Te6edf3myNodeInfo
Tb4b4b4.Te6edf3map Tb4b4b4{ Tffa657itTff7b72?.Te6edf3maxChannelsTff7b72?.Te6edf3takeIf Tb4b4b4{ Te6edf3max Tff7b72-Tff7b72> Te6edf3max Tff7b72> T79c0ff0 Tb4b4b4} Tff7b72?: Te6edf3DEFAULT_MAX_CHANNELS Tb4b4b4}
Tb4b4b4.Te6edf3stateInWhileSubscribedTb4b4b4(
Te6edf3initialValue Tff7b72= Te6edf3nodeRepositoryTb4b4b4.Te6edf3myNodeInfoTb4b4b4.Te6edf3valueTff7b72?.Te6edf3maxChannelsTff7b72?.Te6edf3takeIf Tb4b4b4{ Tffa657it Tff7b72> T79c0ff0 Tb4b4b4} Tff7b72?: Te6edf3DEFAULT_MAX_CHANNELSTb4b4b4,
Tb4b4b4)
T8b949e/** Set the radio config (also updates our saved copy in preferences). */
Tff7b72fun Td2a8ffsetChannelsTb4b4b4(Te6edf3channelSetTb4b4b4: Te6edf3ChannelSetTb4b4b4) Tff7b72=
Te6edf3safeLaunchTb4b4b4(Te6edf3tag Tff7b72= Ta5d6ff"Ta5d6ffsetChannelsTa5d6ff"Tb4b4b4) Tb4b4b4{ Te6edf3importChannelSetTb4b4b4(Te6edf3channelSetTb4b4b4, Te6edf3radioControllerTb4b4b4, Te6edf3radioConfigRepositoryTb4b4b4) Tb4b4b4}
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.04s